import request from '@/utils/request'

// 获取订单列表
export function getOrderList(params) {
  return request({
    url: '/admin/orders',
    method: 'get',
    params
  })
}

// 获取订单详情
export function getOrderDetail(orderId) {
  return request({
    url: `/admin/orders/${orderId}`,
    method: 'get'
  })
}

// 更新订单状态
export function updateOrderStatus(orderId, status) {
  return request({
    url: `/admin/orders/update_status/${orderId}`,
    method: 'post',
    data: { status }
  })
}

// 添加订单备注
export function addOrderRemark(orderId, remark) {
  return request({
    url: `/admin/orders/add_remark/${orderId}`,
    method: 'post',
    data: { remark }
  })
}

// 手动确认支付
export function confirmOrderPayment(orderId) {
  return request({
    url: `/admin/orders/confirm_payment/${orderId}`,
    method: 'post'
  })
}

// 订单统计
export function getOrderStatistics(params) {
  return request({
    url: '/admin/orders/statistics',
    method: 'get',
    params
  })
} 